package com.ym.medical.domain.param;

import com.ym.common.constant.BeanCovert;
import com.ym.medical.domain.entity.UserEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;

/**
 * 终端用户对象 user
 *
 * @author ym
 * @date 2020-08-17
 */
@ApiModel("终端用户-修改")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserUpdateParam extends BeanCovert<UserEntity>{

    @ApiModelProperty("主键")
    @NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
    private Long id;

    @ApiModelProperty("签名ID")
    private Long signId;

    @ApiModelProperty("用户昵称")
    @Size(max = 30, message = "用户昵称长度超过{max}", groups = {Add.class, Update.class})
    private String nickName;

    @ApiModelProperty("真实姓名")
    @Size(max = 32, message = "真实姓名长度超过{max}", groups = {Add.class, Update.class})
    private String realName;

    @ApiModelProperty("手机号")
    @Size(max = 20, message = "手机号长度超过{max}", groups = {Add.class, Update.class})
    private String phoneNo;

    @ApiModelProperty("登录密码")
    @Size(max = 50, message = "登录密码长度超过{max}", groups = {Add.class, Update.class})
    private String userPwd;

    @ApiModelProperty("01 未知  02 男 03 女 04 保密")
    @Size(max = 2, message = "01未知02男03女04保密长度超过{max}", groups = {Add.class, Update.class})
    private String sex;

    @ApiModelProperty("二维码")
    @Size(max = 64, message = "二维码长度超过{max}", groups = {Add.class, Update.class})
    private String qrCode;

    @ApiModelProperty("联系地址")
    @Size(max = 255, message = "联系地址长度超过{max}", groups = {Add.class, Update.class})
    private String contactAddr;

    @ApiModelProperty("身份证	1 港澳台通行证	10部队干部离休证	11工商执照	12单位证明（含公章）	13驾驶证	14学生证	2教师证	3户口本/居住证	4老人证	5组织机构代码证	6军官证	7护照	8虚拟证件	9")
    @Size(max = 2, message = "身份证	1 港澳台通行证	10部队干部离休证	11工商执照	12单位证明长度超过{max}", groups = {Add.class, Update.class})
    private String cardType;

    @ApiModelProperty("证件 号码")
    @Size(max = 32, message = "证件号码长度超过{max}", groups = {Add.class, Update.class})
    private String cardNo;

    @ApiModelProperty("生日")
    private Date birthday;

    @ApiModelProperty("邮箱")
    @Size(max = 32, message = "邮箱长度超过{max}", groups = {Add.class, Update.class})
    private String email;

    @ApiModelProperty("账号类型")
    @Size(max = 2, message = "账号类型长度超过{max}", groups = {Add.class, Update.class})
    private String userType;

    @ApiModelProperty("用户 状态")
    @Size(max = 2, message = "用户状态长度超过{max}", groups = {Add.class, Update.class})
    private String userState;

    @ApiModelProperty("认证状态")
    @Size(max = 2, message = "认证状态长度超过{max}", groups = {Add.class, Update.class})
    private String certState;

    @ApiModelProperty("头像地址")
    @Size(max = 200, message = "头像地址长度超过{max}", groups = {Add.class, Update.class})
    private String headUrl;

    @ApiModelProperty("上次登录时间")
    @NotNull(message = "上次登录时间不能为空", groups = {Add.class, Update.class})
    private Date lastLoginTime;

    @ApiModelProperty("登录设备")
    @Size(max = 32, message = "登录设备长度超过{max}", groups = {Add.class, Update.class})
    private String loginDevice;

    @ApiModelProperty("登录IP")
    @Size(max = 32, message = "登录IP长度超过{max}", groups = {Add.class, Update.class})
    private String loginIp;

}
